<?php
namespace Home\Controller;
use Think\Controller;
class JsonController extends Controller {
    public function getindex(){

        $clubmodel=M('club');

        $club=$clubmodel->order('club_id asc')->select();
        $this->club=$club;
        echo json_encode($club);
    }
    public function getxq(){
        $club_id=$_GET['club_id'];
        $xqmodel=M('club');

        $xq=$xqmodel->select($club_id);
        $this->xq=$xq;
        $this->ajaxReturn($xq,'JSON');


    }
    public function getClubVideo(){

        $id=$_GET['id'];
        //调用模型层获取数据
        $videomodel=M('video');

        $videio=$videomodel->table('videio a,club c')->where("id=$id and id=id")->field('*,c_name')->select();

        //调用视图层显示数据

        $this->ajaxReturn($video,'JSON');

    }
    public function getclass(){

        $c_id=$_GET['c_id'];
        //调用模型层获取数据
        $classmodel=M('class');

        $class=$classmodel->table('class t,club c')->where("id=$c_id and id=id")->field('*name')->select();

        //调用视图层显示数据
        $this->ajaxReturn($class,'JSON');

    }
}